import axios from "axios";
import nProgress from "nprogress";

const huangRequest = axios.create({
    baseURL:"/huang"
})


//请求拦截
huangRequest.interceptors.request.use(
    config=>{
        nProgress.start();
        return config
    }
)

//响应拦截
huangRequest.interceptors.response.use(
    response => {
        nProgress.done();
        return response.data;
    },
    error => {
        nProgress.done();
        console.log(error);
        return new Promise(()=>{})
    }
)


export default huangRequest